-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should fix more but now all "Error in sys.excepthook:" #1069
Conversation
pre-commit.ci autofix |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1069 +/- ##
===========================================
- Coverage 82.18% 81.91% -0.28%
===========================================
Files 24 24
Lines 5171 5171
Branches 1242 1237 -5
===========================================
- Hits 4250 4236 -14
- Misses 622 634 +12
- Partials 299 301 +2 ☔ View full report in Codecov by Sentry. |
I would ignore that pre-commit failure for now. I cannot reproduce that one locally. Seems to be a bug. |
I still see
|
Yep. Those are the ones related to the mocked netCDF. I still could not get rid of them... At least we reduced them a bit 😬 |
@jcermauwedu latest commit squashed the remaining ones. Do you mind taking another look? BTW, is the segfault gone? I'm concerned about that b/c it can lead to corrupted files! |
@@ -495,11 +495,12 @@ def _find_aux_coord_vars(self, ds, refresh=False): | |||
:return: List of variable names (str) that are defined to be auxiliary | |||
coordinate variables. | |||
""" | |||
ds_str = ds.__str__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjwadams this is not elegant but using the actual netCDF4.Dataset
object here was leading to odd behaviors. I guess that the str
representation of the dataset is unique and "safe" enough for this use. Maybe a hash would be more appropriated, but it tuns hashing netCDF objects is not easy!
I will exercise it a bit to see if the segfault appears. |
After 100 straight iterations, no segfault. |
@ocefpaf, LRU caching was used because some functions repeatedly used In theory, since the datasets are read-only, only one set of attribute fetches should be needed. I'm OK with regressing performance since the cache implementation appears to be causing issues. |
@benjwadams, like I mentioned above, get_variables_by_attributes caching was upstreamed. If that is the only source of slow downs, then there will be no performance regressions. See Unidata/netcdf4-python#1253 |
@benjwadams I'd love to get this one in before the code sprint to avoid code conflicts and to help folks get a dev environment that doesn't segfault. |
Solves some of the
Error in sys.excepthook:
reported in #1067In this PR:
get_variables_by_attributes
method. That was upstream, I don't see any places that justify keeping caches here. @benjwadams do we have some speed stress test to verify that?ds
tonc
for consistency.base.py
, we were playing whack-a-mole there.__dealloc__
method and import do not import Dataset from the private module.@benjwadams if you agree with these changes please merge and I'll chase the other
Error in sys.excepthook
in another PR, as far as I can see they are not related to caching but I may be wrong.